#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    int nonSpecialCount(int l, int r) {
        int tot = r - l + 1;
        int n = sqrt((double)r);
        vector<bool> v(n + 1);
        for (int i = 2; i <= n; i++) {
            if (v[i] == false) {
                if (i * i >= l && i * i <= r) {
                    tot--;
                }
                for (int j = 2 * i; j <= n; j += i) {
                    v[j] = true;
                }
            }
        }
        return tot;
    }  
};

int main() {
    Solution s;
    cout << s.nonSpecialCount(5, 16);
}